package com.ruoyi.farmwell.fault.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.farmwell.fault.domain.WellFault;
import com.ruoyi.farmwell.fault.mapper.WellFaultMapper;
import com.ruoyi.farmwell.fault.service.IWellFaultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 机井故障表Service业务层处理
 * 
 * @author zjp
 * @date 2024-08-09
 */
@Service
public class WellFaultServiceImpl implements IWellFaultService
{
    @Autowired
    private WellFaultMapper wellFaultMapper;

    /**
     * 查询机井故障表
     * 
     * @param id 机井故障表主键
     * @return 机井故障表
     */
    @Override
    public WellFault selectWellFaultById(Long id)
    {
        return wellFaultMapper.selectWellFaultById(id);
    }

    /**
     * 查询机井故障表列表
     * 
     * @param wellFault 机井故障表
     * @return 机井故障表
     */
    @Override
    public List<WellFault> selectWellFaultList(WellFault wellFault)
    {
        return wellFaultMapper.selectWellFaultList(wellFault);
    }

    /**
     * 新增机井故障表
     * 
     * @param wellFault 机井故障表
     * @return 结果
     */
    @Override
    public int insertWellFault(WellFault wellFault)
    {
        wellFault.setCreateTime(DateUtils.getNowDate());
        return wellFaultMapper.insertWellFault(wellFault);
    }

    /**
     * 修改机井故障表
     * 
     * @param wellFault 机井故障表
     * @return 结果
     */
    @Override
    public int updateWellFault(WellFault wellFault)
    {
        wellFault.setUpdateTime(DateUtils.getNowDate());
        return wellFaultMapper.updateWellFault(wellFault);
    }

    /**
     * 批量删除机井故障表
     * 
     * @param ids 需要删除的机井故障表主键
     * @return 结果
     */
    @Override
    public int deleteWellFaultByIds(Long[] ids)
    {
        return wellFaultMapper.deleteWellFaultByIds(ids);
    }

    /**
     * 删除机井故障表信息
     * 
     * @param id 机井故障表主键
     * @return 结果
     */
    @Override
    public int deleteWellFaultById(Long id)
    {
        return wellFaultMapper.deleteWellFaultById(id);
    }
}
